﻿<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>

<script runat="server">
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.ddlCountries.DataSource = Database.Current.GetAllCountries();
            this.ddlCountries.DataBind();

            Fillgv();
        }
    }

    private void Fillgv()
    {
        int? value = int.Parse(this.ddlCountries.SelectedValue);
        value = value == 0 ? null : value;
        //------------------------------------------------------------
        DateTime dtvalueExact;
        DateTime? dtvalue = null;
        if (DateTime.TryParse(this.txtPublish.Text, out dtvalueExact))
            dtvalue = dtvalueExact;
        //------------------------------------------------------------
        this.gvResult.DataSource = Database.Current.GetFilteredBusinessOpp(value, dtvalue);
        this.gvResult.DataBind();
    }
    private void btnFilter(object sender, EventArgs e)
    {
        Fillgv();
    }
   
</script>

<html lang="en">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Bussiness Opportunities</title>
    <style type="text/css">
        #news_title
        {
            height: 25px;
            width: 510px;
            padding-top: 7px;
            background-color: #84BD60;
            font-size: 16px;
            font-weight: bold;
            color: #FFF;
            text-align: center;
        }
        a:link
        {
            color: #FFF;
            text-decoration: none;
        }
        a:visited
        {
            color: #FFF;
            text-decoration: none;
        }
        a:hover
        {
            color: #FFF;
            text-decoration: none;
        }
        a:active
        {
            color: #FFF;
            text-decoration: none;
        }
        table
        {
            table-layout: fixed;
        }
        td
        {
            word-wrap: break-word;
        }
        body
        {
            /* These rules have no effect on the functionality */ /* They are for styling only */
            margin: 0;
            padding: 20px 0 0 0;
        }
        img.bg
        {
            /* Set rules to fill background */
            min-height: 100%;
            min-width: 1024px; /* Set up proportionate scaling */
            width: 100%;
            height: auto; /* Set up positioning */
            position: fixed;
            top: 0;
            left: 0;
        }
        div#content
        {
            /* This is the only important rule */ /* We need our content to show up on top of the background */
            position: relative; /* These have no effect on the functionality */
            font-family: helvetica, arial, sans-serif;
            font-size: 10pt;
            line-height: 16pt;
            width: 800px;
            -moz-box-shadow: #000 4px 4px 10px;
            -webkit-box-shadow: #000 4px 4px 10px;
            margin-top: 0;
            margin-right: auto;
            margin-bottom: 0;
            margin-left: auto;
            color: White;
        }
        #middle_contents
        {
            width: 800px;
            background-color: #FFF;
            height: 1000px;
            background-image: url(images/pattern-1.png);
            background-repeat: repeat-y;
        }
        #header
        {
            height: 200px;
            width: 800px;
            background-color: #FFF;
            background-image: url(images/header_bg.png);
        }
        #up_cleare_bar
        {
            height: 10px;
            width: 800px;
        }
        #menu
        {
            background-color: #84BD60;
            float: left;
            height: 40px;
            width: 800px;
        }
        #Up_lang
        {
            height: 20px;
            width: 800px;
            text-align: right;
            color: #FFF;
            text-decoration: none;
        }
        #flasha
        {
            background-color: #000;
            float: right;
            height: 160px;
            width: 450px;
        }
        #logo
        {
            float: left;
            height: 160px;
            width: 350px;
            background-image: url(images/logo.png);
        }
        #news_box
        {
            height: 950px;
            width: 510px;
            float: left;
            margin-right: 10px;
            background-image: url(images/frame_1.png);
            margin-top: 10px;
            margin-left: 10px;
        }
        #ruls_title
        {
            background-color: #84BD60;
            height: 25px;
            width: auto;
            padding-top: 7px;
            border-bottom-width: 1px;
            border-bottom-style: solid;
            border-bottom-color: #FFF;
            font-size: 18px;
            color: #FFF;
            text-align: center;
        }
        #ruls_word
        {
            text-align: center;
            height: 26px;
            width: 100px;
            margin-right: auto;
            margin-left: auto;
            margin-top: 10px;
            font-size: 16px;
            text-decoration: underline;
            font-weight: bold;
            color: #FFF;
        }
        #ruls_box
        {
            float: right;
            height: 80px;
            width: 260px;
            background-image: url(images/frame_1.png);
            margin-top: 10px;
            margin-right: 10px;
        }
        #footer
        {
            background-image: url(images/frame_1.png);
            height: 35px;
            width: 800px;
            margin-right: auto;
            margin-left: auto;
            padding-top: 15px;
            color: #FFF;
            font-size: 13;
            text-align: center;
        }
        .table_class
        {
            font-size: 13px;
            color: #FFF;
            text-align: center;
            font-weight: bold;
        }
        #contract_box
        {
            float: right;
            height: 80px;
            width: 260px;
            margin-top: 10px;
            background-image: url(images/frame_1.png);
            margin-right: 10px;
        }
        #contract_title
        {
            background-color: #84BD60;
            height: 25px;
            width: auto;
            padding-top: 7px;
            border-bottom-width: 1px;
            border-bottom-style: solid;
            border-bottom-color: #FFF;
            font-size: 18px;
            color: #FFF;
            text-align: center;
        }
        #flags
        {
            float: right;
            height: 400px;
            width: 260px;
            margin-top: 10px;
            margin-right: 10px;
        }
        #contaract_word
        {
            text-align: center;
            height: 26px;
            width: 100px;
            margin-right: auto;
            margin-left: auto;
            margin-top: 10px;
            font-size: 16px;
            text-decoration: underline;
            font-weight: bold;
            color: #FFF;
        }
        -- ></style>

    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>

</head>
<body>
    <img src="images/bg.jpg" class="bg" />
    <div id="content">
        <div id="Up_lang">
            <a href="Default.aspx">عربى</a></div>
        <div id="header">
            <div id="flasha">
                <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="450"
                    height="160">
                    <param name="movie" value="swf/E.swf">
                    <param name="quality" value="high">
                    <param name="wmode" value="opaque">
                    <param name="swfversion" value="6.0.65.0">
                    <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
                    <param name="expressinstall" value="Scripts/expressInstall.swf">
                    <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
                    <!--[if !IE]>-->
                    <object type="application/x-shockwave-flash" data="swf/E.swf" width="450" height="160">
                        <!--<![endif]-->
                        <param name="quality" value="high">
                        <param name="wmode" value="opaque">
                        <param name="swfversion" value="6.0.65.0">
                        <param name="expressinstall" value="Scripts/expressInstall.swf">
                        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                        <div>
                            <h4>
                                Content on this page requires a newer version of Adobe Flash Player.</h4>
                            <p>
                                <a href="http://www.adobe.com/go/getflashplayer">
                                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
                                        alt="Get Adobe Flash player" /></a></p>
                        </div>
                        <!--[if !IE]>-->
                    </object>
                    <!--<![endif]-->
                </object>
            </div>
            <div id="logo">
            </div>
            <div id="menu">
                <table width="800" height="40" align="center" class="table_class">
                    <tr>
                        <td width="73">
                            <a href="English.aspx">Home</a>
                        </td>
                        <td width="88">
                            <a href="about.html">About</a>
                        </td>
                        <td width="124">
                            <a href="imprtant_info.html">Important Info</a>
                        </td>
                        <td width="131">
                            <a href="related_links.aspx">Related Links</a>
                        </td>
                        <td width="167">
                            <a href="buss_opp.aspx">Business Opportunities</a>
                        </td>
                        <td width="103">
                            <a href="Members.html">Members</a>
                        </td>
                        <td width="82">
                            <a href="contact.aspx">Contacts</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="up_cleare_bar">
        </div>
        <div id="middle_contents">
            <div id="contract_box">
                <div id="contract_title">
                    Contract</div>
                <div id="contaract_word">
                    <a href="Download/contract.pdf">
                        <img src="images/Untitled-sd2.pnga.png" width="100" height="25" border="0"></a></div>
            </div>
            <form runat="server">
            <asp:ToolkitScriptManager runat="server" />
            <div id="news_box">
                <div id="news_title">
                    Business Opportunities
                </div>
                <table>
                    <tr>
                        <td>
                            Country:
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="ddlCountries" Style="width: 130px;" AppendDataBoundItems="true"
                                DataTextField="NameEn" DataValueField="ID">
                                <asp:ListItem Text="-- Select Country --" Value="0"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td>
                            Published After:
                        </td>
                        <td>
                            <asp:TextBox runat="server" ID="txtPublish" />
                            <asp:ImageButton runat="server" ID="btnCalnder" ImageUrl="~/Images/calendar.gif" />
                            <asp:CalendarExtender ID="cal" runat="server" TargetControlID="txtPublish" PopupButtonID="btnCalnder" />
                        </td>
                        <td style="text-align: center">
                            <asp:LinkButton runat="server" Text="Filter Results" OnClick="btnFilter"></asp:LinkButton>
                        </td>
                    </tr>
                </table>
                <asp:GridView Font-Size="Small" runat="Server" ID="gvResult" 
                    AutoGenerateColumns="False" AllowPaging="True" PageSize="8">
                    <HeaderStyle VerticalAlign="Top" HorizontalAlign="Center" BackColor="#84BD60" />
                    <RowStyle VerticalAlign="Top" HorizontalAlign="Center" />
                    <Columns>
                        <asp:BoundField DataField="DescriptionEn" HeaderText="SUBJECT" />
                        <asp:BoundField DataField="Deadline" HeaderText="OPENING DATE" DataFormatString="{0:d}" />
                        <asp:BoundField DataField="BidBound" HeaderText="BID BOUND" DataFormatString="{0:C}" />
                        <asp:BoundField DataField="SpecsFees" HeaderText="SPECS FEES" DataFormatString="{0:C}" />
                        <asp:BoundField DataField="Publications" HeaderText="DATE PUBLISHED" DataFormatString="{0:d}" />
                        <asp:HyperLinkField HeaderText="MORE" Text="More" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="buss_opp_details.aspx?ID={0}">
                            <ItemStyle Font-Underline="True" />
                        </asp:HyperLinkField>
                    </Columns>
                </asp:GridView>
            </div>
            </form>
            <div id="ruls_box">
                <div id="ruls_title">
                    Rules</div>
                <div id="ruls_word">
                    <a href="Download/rules.pdf">
                        <img src="images/Untitled-sd2.pnga.png" width="100" height="25" border="0"></a></div>
            </div>
            <div id="flags">
                <object id="FlashID2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="260"
                    height="400">
                    <param name="movie" value="swf/flasgs.swf">
                    <param name="quality" value="high">
                    <param name="wmode" value="opaque">
                    <param name="swfversion" value="6.0.65.0">
                    <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
                    <param name="expressinstall" value="Scripts/expressInstall.swf">
                    <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
                    <!--[if !IE]>-->
                    <object type="application/x-shockwave-flash" data="swf/flasgs.swf" width="260" height="400">
                        <!--<![endif]-->
                        <param name="quality" value="high">
                        <param name="wmode" value="opaque">
                        <param name="swfversion" value="6.0.65.0">
                        <param name="expressinstall" value="Scripts/expressInstall.swf">
                        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                        <div>
                            <h4>
                                Content on this page requires a newer version of Adobe Flash Player.</h4>
                            <p>
                                <a href="http://www.adobe.com/go/getflashplayer">
                                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
                                        alt="Get Adobe Flash player" /></a></p>
                        </div>
                        <!--[if !IE]>-->
                    </object>
                    <!--<![endif]-->
                </object>
            </div>
        </div>
        <div id="footer">
            © Copyright 2010 FAC.WebDesign &amp; Developmenet By Ebhar Creative Studios , All
            Rights Reserved</div>
    </div>

    <script type="text/javascript">
<!--
        swfobject.registerObject("FlashID");
//-->
    </script>

</body>
</html>
